.TH "src/messages.h" 3 "Fri Apr 15 2016" "Version 0.10.0-146_trunk" "libnetconf" \" -*- nroff -*-
.ad l
.nh
.SH NAME
src/messages.h \- 
.PP
Functions to create NETCONF messages\&.  

.SH SYNOPSIS
.br
.PP
\fC#include <time\&.h>\fP
.br
\fC#include 'netconf\&.h'\fP
.br
\fC#include 'error\&.h'\fP
.br

.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBnc_filter_free\fP (struct nc_filter *filter)"
.br
.RI "\fIDestroy the filter structure\&. \fP"
.ti -1c
.RI "struct nc_filter * \fBnc_filter_new\fP (\fBNC_FILTER_TYPE\fP type,\&.\&.\&.)"
.br
.RI "\fICreate a new NETCONF filter of the specified type\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_build\fP (const char *reply_dump)"
.br
.RI "\fIBuild <rpc-reply> message from the string\&. This is the reverse function of the \fBnc_reply_dump()\fP\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_data\fP (const char *data)"
.br
.RI "\fICreate rpc-reply response with <data> content (in urn:ietf:params:xml:ns:netconf:base:1\&.0 namespace)\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_data_ns\fP (const char *data, const char *ns)"
.br
.RI "\fICreate rpc-reply response with <data> content in the specified namespace\&. \fP"
.ti -1c
.RI "char * \fBnc_reply_dump\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIDump the rpc-reply message into a string\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_dup\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIDuplicate <reply> message\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_error\fP (struct nc_err *error)"
.br
.RI "\fICreate rpc-reply response with <rpc-error> content\&. \fP"
.ti -1c
.RI "int \fBnc_reply_error_add\fP (\fBnc_reply\fP *reply, struct nc_err *error)"
.br
.RI "\fIAdd another error description into the existing rpc-reply with <rpc-error> content\&. \fP"
.ti -1c
.RI "void \fBnc_reply_free\fP (\fBnc_reply\fP *reply)"
.br
.RI "\fIFree reply message\&. \fP"
.ti -1c
.RI "char * \fBnc_reply_get_data\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIGet content of the <data> element in <rpc-reply>\&. \fP"
.ti -1c
.RI "const char * \fBnc_reply_get_data_ns\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIGet namespace of the <data> element in <rpc-reply>\&. \fP"
.ti -1c
.RI "const char * \fBnc_reply_get_errormsg\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIGet error-message from the server's <rpc-error> reply\&. \fP"
.ti -1c
.RI "const \fBnc_msgid\fP \fBnc_reply_get_msgid\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIGet message-id of the given rpc-reply\&. \fP"
.ti -1c
.RI "\fBNC_REPLY_TYPE\fP \fBnc_reply_get_type\fP (const \fBnc_reply\fP *reply)"
.br
.RI "\fIGet the type of the rpc-reply message\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_merge\fP (int count,\&.\&.\&.)"
.br
.RI "\fIMerge reply messages\&. All messages MUST be of the same type\&. \fP"
.ti -1c
.RI "\fBnc_reply\fP * \fBnc_reply_ok\fP (void)"
.br
.RI "\fICreate <ok> rpc-reply response\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_build\fP (const char *rpc_dump, const struct nc_session *session)"
.br
.RI "\fIBuild <rpc> message from the string\&. This is the reverse function of the \fBnc_rpc_dump()\fP\&. \fP"
.ti -1c
.RI "int \fBnc_rpc_capability_attr\fP (\fBnc_rpc\fP *rpc, \fBNC_CAP_ATTR\fP attr,\&.\&.\&.)"
.br
.RI "\fISet the attribute of the given <rpc> which is specific for some NETCONF capability\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_commit\fP (void)"
.br
.RI "\fICreate <commit> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_copyconfig\fP (\fBNC_DATASTORE\fP source, \fBNC_DATASTORE\fP target,\&.\&.\&.)"
.br
.RI "\fICreate <copy-config> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_deleteconfig\fP (\fBNC_DATASTORE\fP target,\&.\&.\&.)"
.br
.RI "\fICreate <delete-config> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_discardchanges\fP (void)"
.br
.RI "\fICreate <discard-changes> NETCONF rpc message\&. \fP"
.ti -1c
.RI "char * \fBnc_rpc_dump\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIDump the rpc message into a string\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_dup\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIDuplicate <rpc> message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_editconfig\fP (\fBNC_DATASTORE\fP target, \fBNC_DATASTORE\fP source, \fBNC_EDIT_DEFOP_TYPE\fP default_operation, \fBNC_EDIT_ERROPT_TYPE\fP error_option, \fBNC_EDIT_TESTOPT_TYPE\fP test_option,\&.\&.\&.)"
.br
.RI "\fICreate <edit-config> NETCONF rpc message\&. \fP"
.ti -1c
.RI "void \fBnc_rpc_free\fP (\fBnc_rpc\fP *rpc)"
.br
.RI "\fIFree rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_generic\fP (const char *data)"
.br
.RI "\fICreate a generic NETCONF rpc message with the specified content\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_get\fP (const struct nc_filter *filter)"
.br
.RI "\fICreate <get> NETCONF rpc message\&. \fP"
.ti -1c
.RI "char * \fBnc_rpc_get_config\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet serialized content of the config parameter (<config> itself is not a part of the returned data)\&. This function is valid only for <copy-config> and <edit-config> RPCs\&. \fP"
.ti -1c
.RI "\fBNC_EDIT_DEFOP_TYPE\fP \fBnc_rpc_get_defop\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet default-operation type, valid only for <edit-config> RPCs\&. \fP"
.ti -1c
.RI "\fBNC_EDIT_ERROPT_TYPE\fP \fBnc_rpc_get_erropt\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet error-option type, valid only for <edit-config> RPCs\&. \fP"
.ti -1c
.RI "struct nc_filter * \fBnc_rpc_get_filter\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet filter from <get> or <get-config> RPC\&. \fP"
.ti -1c
.RI "const \fBnc_msgid\fP \fBnc_rpc_get_msgid\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet message-id of the given rpc\&. \fP"
.ti -1c
.RI "char * \fBnc_rpc_get_ns\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet user's rpc operation namespace\&. \fP"
.ti -1c
.RI "\fBNC_OP\fP \fBnc_rpc_get_op\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet operation of the given rpc\&. \fP"
.ti -1c
.RI "char * \fBnc_rpc_get_op_content\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet content of the operation specification from the given rpc\&. \fP"
.ti -1c
.RI "char * \fBnc_rpc_get_op_name\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet operation name of the given rpc\&. \fP"
.ti -1c
.RI "char * \fBnc_rpc_get_op_namespace\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet operation namespace of the given rpc\&. \fP"
.ti -1c
.RI "\fBNC_DATASTORE\fP \fBnc_rpc_get_source\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet the source datastore type (running, startup, candidate) of the rpc request\&. \fP"
.ti -1c
.RI "\fBNC_DATASTORE\fP \fBnc_rpc_get_target\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet the target datastore type (running, startup, candidate) of the rpc request\&. \fP"
.ti -1c
.RI "\fBNC_EDIT_TESTOPT_TYPE\fP \fBnc_rpc_get_testopt\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet test-option type, valid only for <edit-config> RPCs supporting :validate:1\&.1 capability\&. \fP"
.ti -1c
.RI "\fBNC_RPC_TYPE\fP \fBnc_rpc_get_type\fP (const \fBnc_rpc\fP *rpc)"
.br
.RI "\fIGet type of the rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_getconfig\fP (\fBNC_DATASTORE\fP source, const struct nc_filter *filter)"
.br
.RI "\fICreate <get-config> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_getschema\fP (const char *name, const char *version, const char *format)"
.br
.RI "\fICreate <get-schema> NETCONF rpc message (RFC 6022)\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_killsession\fP (const char *kill_sid)"
.br
.RI "\fICreate <kill-session> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_lock\fP (\fBNC_DATASTORE\fP target)"
.br
.RI "\fICreate <lock> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_subscribe\fP (const char *stream, const struct nc_filter *filter, const time_t *start, const time_t *stop)"
.br
.RI "\fICreate <create-subsciption> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_unlock\fP (\fBNC_DATASTORE\fP target)"
.br
.RI "\fICreate <unlock> NETCONF rpc message\&. \fP"
.ti -1c
.RI "\fBnc_rpc\fP * \fBnc_rpc_validate\fP (\fBNC_DATASTORE\fP source,\&.\&.\&.)"
.br
.RI "\fICreate <validate> NETCONF rpc message\&. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Functions to create NETCONF messages\&. 


.PP
\fBAuthor:\fP
.RS 4
Radek Krejci rkrejci@cesnet.cz Copyright (c) 2012-2014 CESNET, z\&.s\&.p\&.o\&.
.RE
.PP
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
.IP "1." 4
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&.
.IP "2." 4
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&.
.IP "3." 4
Neither the name of the Company nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\&.
.PP
.PP
ALTERNATIVELY, provided that this notice is retained in full, this product may be distributed under the terms of the GNU General Public License (GPL) version 2 or later, in which case the provisions of the GPL apply INSTEAD OF those given above\&.
.PP
This software is provided ``as is, and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed\&. In no event shall the company or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage\&. 
.SH "Author"
.PP 
Generated automatically by Doxygen for libnetconf from the source code\&.
